function toTree(data) {
    var result = []
    if (!Array.isArray(data)) {
        return result
    }
    data.forEach(item => {
        delete item.children;
    });
    let map = {};
    data.forEach(item => {
        map[item.MenuNo] = item;
    });
 
    data.forEach(item => {
        let parent = map[item.MenuParentNo];
        if (parent) {
            (parent.children || (parent.children = [])).push(item);
        } else {
            result.push(item);
        }
    });
    return result;
}
function splitFileName(text) {
    var pattern = /\.{1}[a-z]{1,}$/
    if (pattern.exec(text) !== null) {
        return text.slice(0, pattern.exec(text).index)
    } else {
        return text
    }
}

export default toTree;

